home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 788 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  582 b 

  1. Path: news.production.compuserve.com!news
  2. From: Merlin Chowkwanyun <71702.1123@CompuServe.COM>
  3. Newsgroups: comp.lang.c,comp.lang.c++
  4. Subject: Re: RANDOM NUMBER GENERATOR
  5. Date: 7 Jan 1996 04:33:51 GMT
  6. Organization: CompuServe, Inc. (1-800-689-0736)
  7. Message-ID: <4cniff$11o$1@mhade.production.compuserve.com>
  8.  
  9. Just thought you might like to know that I found this random number generator
  10. lying around in an old C++ magazine
  11.  
  12. /declares a global random number generating function
  13.  
  14. int random(int MaxVal)
  15. {
  16.  return rand() % MaxVal;
  17. }
  18.  
  19. Be sure to include the header file stdlib.h
  20.  
  21. Merlin
  22.